<h1>小工具管理</h1>

<table>
  <tr>
    <th style="width: 8%">编号</th>
    <th style="width: 50%">标题</th>
    <th style="width: 15%">显示</th>
    <th style="width: 15%">排序</th>
    <th>操作</th>
  </tr>

  <% @widgets.each do |widget| %>
    <tr>
      <td><%=h widget.id %></td>
      <td><%=h widget.title %></td>
      <td><%=h widget.display %></td>
      <td><%=h widget.index_num %></td>
      <td><%= link_to_remote image_tag('edit.png',:title => '编辑'), :update => 'content', :method => :get, :url => edit_widget_path(widget) %>
        <%= link_to image_tag('delete.png',:title => '删除'), widget, :confirm => 'Are you sure?', :method => :delete %></td>
    </tr>
  <% end %>
</table>

<%= link_to_remote '创建小工具', :update => 'content', :method => :get, :url => new_widget_path %>